﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Data;
using System.Web.UI.WebControls;

namespace Team4Mock.UserControl.Premise
{
    public partial class ListAll : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (string.IsNullOrEmpty(Convert.ToString(Request.QueryString["ID"])))
                {
                    pnAdd.Visible = false;
                    pnView.Visible = true;
                    DataTable dt4 = new DataTable();

                    dt4.Columns.Add("ID", typeof(int));
                    dt4.Columns.Add("Location Name");
                    dt4.Columns.Add("Address Line 1");
                    dt4.Columns.Add("Post Code");
                    dt4.Columns.Add("Contact");
                    dt4.Columns.Add("Is Active");


                    dt4.Rows.Add(1, "ZAdsadsadasdas", "3223232", "dasdasd", "Adasdas", "Yes");
                    dt4.Rows.Add(2, "CBsadsadasdas", "3223232", "dasdasd", "Bdasdas", "Yes");
                    dt4.Rows.Add(3, "FBdsadsadasdas", "3223232", "dasdasd", "Cdasdas", "Yes");
                    dt4.Rows.Add(4, "GDdsadsadasdas", "3223232", "dasdasd", "Ddasdas", "Yes");
                    dt4.Rows.Add(5, "AEdsadsadasdas", "3223232", "dasdasd", "Edasdas", "Yes");
                    dt4.Rows.Add(6, "KFdsadsadasdas", "3223232", "dasdasd", "Fdasdas", "Yes");
                    dt4.Rows.Add(7, "BGdsadsadasdas", "3223232", "dasdasd", "Gdasdas", "Yes");
                    gvPremise.DataSource = dt4;
                    gvPremise.DataBind();
                }
                else
                {
                    pnAdd.Visible = true;
                    pnView.Visible = false;
                }

            }
        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            pnAdd.Visible = true;
            pnView.Visible = false;
        }
    }
}